Optimal. Leaf size=171 \[ \frac {1}{8} \left (8 a^3 c+12 a b^2 c+12 a^2 b d+3 b^3 d\right ) x-\frac {\left (16 a^2 b c+4 b^3 c+3 a^3 d+12 a b^2 d\right ) \cos (e+f x)}{6 f}-\frac {b \left (20 a b c+6 a^2 d+9 b^2 d\right ) \cos (e+f x) \sin (e+f x)}{24 f}-\frac {(4 b c+3 a d) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac {d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 171, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {2832, 2813}
\begin {gather*} -\frac {b \left (6 a^2 d+20 a b c+9 b^2 d\right ) \sin (e+f x) \cos (e+f x)}{24 f}-\frac {\left (3 a^3 d+16 a^2 b c+12 a b^2 d+4 b^3 c\right ) \cos (e+f x)}{6 f}+\frac {1}{8} x \left (8 a^3 c+12 a^2 b d+12 a b^2 c+3 b^3 d\right )-\frac {(3 a d+4 b c) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac {d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2813
Rule 2832
Rubi steps
\begin {align*} \int (a+b \sin (e+f x))^3 (c+d \sin (e+f x)) \, dx &=-\frac {d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f}+\frac {1}{4} \int (a+b \sin (e+f x))^2 (4 a c+3 b d+(4 b c+3 a d) \sin (e+f x)) \, dx\\ &=-\frac {(4 b c+3 a d) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac {d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f}+\frac {1}{12} \int (a+b \sin (e+f x)) \left (12 a^2 c+8 b^2 c+15 a b d+\left (20 a b c+6 a^2 d+9 b^2 d\right ) \sin (e+f x)\right ) \, dx\\ &=\frac {1}{8} \left (8 a^3 c+12 a b^2 c+12 a^2 b d+3 b^3 d\right ) x-\frac {\left (16 a^2 b c+4 b^3 c+3 a^3 d+12 a b^2 d\right ) \cos (e+f x)}{6 f}-\frac {b \left (20 a b c+6 a^2 d+9 b^2 d\right ) \cos (e+f x) \sin (e+f x)}{24 f}-\frac {(4 b c+3 a d) \cos (e+f x) (a+b \sin (e+f x))^2}{12 f}-\frac {d \cos (e+f x) (a+b \sin (e+f x))^3}{4 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.72, size = 142, normalized size = 0.83 \begin {gather*} \frac {-24 \left (12 a^2 b c+3 b^3 c+4 a^3 d+9 a b^2 d\right ) \cos (e+f x)+8 b^2 (b c+3 a d) \cos (3 (e+f x))+3 \left (4 \left (8 a^3 c+12 a b^2 c+12 a^2 b d+3 b^3 d\right ) (e+f x)-8 b \left (3 a b c+3 a^2 d+b^2 d\right ) \sin (2 (e+f x))+b^3 d \sin (4 (e+f x))\right )}{96 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.30, size = 182, normalized size = 1.06
method | result | size |
derivativedivides | \(\frac {a^{3} c \left (f x +e \right )-a^{3} d \cos \left (f x +e \right )-3 a^{2} b c \cos \left (f x +e \right )+3 a^{2} b d \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+3 a \,b^{2} c \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-a \,b^{2} d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-\frac {b^{3} c \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+b^{3} d \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}\) | \(182\) |
default | \(\frac {a^{3} c \left (f x +e \right )-a^{3} d \cos \left (f x +e \right )-3 a^{2} b c \cos \left (f x +e \right )+3 a^{2} b d \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )+3 a \,b^{2} c \left (-\frac {\cos \left (f x +e \right ) \sin \left (f x +e \right )}{2}+\frac {f x}{2}+\frac {e}{2}\right )-a \,b^{2} d \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )-\frac {b^{3} c \left (2+\sin ^{2}\left (f x +e \right )\right ) \cos \left (f x +e \right )}{3}+b^{3} d \left (-\frac {\left (\sin ^{3}\left (f x +e \right )+\frac {3 \sin \left (f x +e \right )}{2}\right ) \cos \left (f x +e \right )}{4}+\frac {3 f x}{8}+\frac {3 e}{8}\right )}{f}\) | \(182\) |
risch | \(a^{3} c x +\frac {3 x \,a^{2} b d}{2}+\frac {3 x a \,b^{2} c}{2}+\frac {3 x \,b^{3} d}{8}-\frac {\cos \left (f x +e \right ) a^{3} d}{f}-\frac {3 \cos \left (f x +e \right ) a^{2} b c}{f}-\frac {9 \cos \left (f x +e \right ) a \,b^{2} d}{4 f}-\frac {3 \cos \left (f x +e \right ) b^{3} c}{4 f}+\frac {b^{3} d \sin \left (4 f x +4 e \right )}{32 f}+\frac {b^{2} \cos \left (3 f x +3 e \right ) a d}{4 f}+\frac {b^{3} \cos \left (3 f x +3 e \right ) c}{12 f}-\frac {3 \sin \left (2 f x +2 e \right ) a^{2} b d}{4 f}-\frac {3 \sin \left (2 f x +2 e \right ) a \,b^{2} c}{4 f}-\frac {\sin \left (2 f x +2 e \right ) b^{3} d}{4 f}\) | \(204\) |
norman | \(\frac {\left (a^{3} c +\frac {3}{2} a^{2} b d +\frac {3}{2} a \,b^{2} c +\frac {3}{8} b^{3} d \right ) x +\left (a^{3} c +\frac {3}{2} a^{2} b d +\frac {3}{2} a \,b^{2} c +\frac {3}{8} b^{3} d \right ) x \left (\tan ^{8}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (4 a^{3} c +6 a^{2} b d +6 a \,b^{2} c +\frac {3}{2} b^{3} d \right ) x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (4 a^{3} c +6 a^{2} b d +6 a \,b^{2} c +\frac {3}{2} b^{3} d \right ) x \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )+\left (6 a^{3} c +9 a^{2} b d +9 a \,b^{2} c +\frac {9}{4} b^{3} d \right ) x \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )-\frac {6 a^{3} d +18 a^{2} b c +12 a \,b^{2} d +4 b^{3} c}{3 f}-\frac {2 \left (a^{3} d +3 a^{2} b c \right ) \left (\tan ^{6}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 \left (3 a^{3} d +9 a^{2} b c +6 a \,b^{2} d +2 b^{3} c \right ) \left (\tan ^{4}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{f}-\frac {2 \left (9 a^{3} d +27 a^{2} b c +24 a \,b^{2} d +8 b^{3} c \right ) \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 f}-\frac {3 b \left (4 a^{2} d +4 a b c +b^{2} d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{4 f}+\frac {3 b \left (4 a^{2} d +4 a b c +b^{2} d \right ) \left (\tan ^{7}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}-\frac {b \left (12 a^{2} d +12 a b c +11 b^{2} d \right ) \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}+\frac {b \left (12 a^{2} d +12 a b c +11 b^{2} d \right ) \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{4 f}}{\left (1+\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )^{4}}\) | \(488\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 189, normalized size = 1.11 \begin {gather*} \frac {96 \, {\left (f x + e\right )} a^{3} c + 72 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a b^{2} c + 32 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} b^{3} c + 72 \, {\left (2 \, f x + 2 \, e - \sin \left (2 \, f x + 2 \, e\right )\right )} a^{2} b d + 96 \, {\left (\cos \left (f x + e\right )^{3} - 3 \, \cos \left (f x + e\right )\right )} a b^{2} d + 3 \, {\left (12 \, f x + 12 \, e + \sin \left (4 \, f x + 4 \, e\right ) - 8 \, \sin \left (2 \, f x + 2 \, e\right )\right )} b^{3} d - 288 \, a^{2} b c \cos \left (f x + e\right ) - 96 \, a^{3} d \cos \left (f x + e\right )}{96 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 153, normalized size = 0.89 \begin {gather*} \frac {8 \, {\left (b^{3} c + 3 \, a b^{2} d\right )} \cos \left (f x + e\right )^{3} + 3 \, {\left (4 \, {\left (2 \, a^{3} + 3 \, a b^{2}\right )} c + 3 \, {\left (4 \, a^{2} b + b^{3}\right )} d\right )} f x - 24 \, {\left ({\left (3 \, a^{2} b + b^{3}\right )} c + {\left (a^{3} + 3 \, a b^{2}\right )} d\right )} \cos \left (f x + e\right ) + 3 \, {\left (2 \, b^{3} d \cos \left (f x + e\right )^{3} - {\left (12 \, a b^{2} c + {\left (12 \, a^{2} b + 5 \, b^{3}\right )} d\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{24 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 386 vs.
\(2 (170) = 340\).
time = 0.25, size = 386, normalized size = 2.26 \begin {gather*} \begin {cases} a^{3} c x - \frac {a^{3} d \cos {\left (e + f x \right )}}{f} - \frac {3 a^{2} b c \cos {\left (e + f x \right )}}{f} + \frac {3 a^{2} b d x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 a^{2} b d x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {3 a^{2} b d \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} + \frac {3 a b^{2} c x \sin ^{2}{\left (e + f x \right )}}{2} + \frac {3 a b^{2} c x \cos ^{2}{\left (e + f x \right )}}{2} - \frac {3 a b^{2} c \sin {\left (e + f x \right )} \cos {\left (e + f x \right )}}{2 f} - \frac {3 a b^{2} d \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 a b^{2} d \cos ^{3}{\left (e + f x \right )}}{f} - \frac {b^{3} c \sin ^{2}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{f} - \frac {2 b^{3} c \cos ^{3}{\left (e + f x \right )}}{3 f} + \frac {3 b^{3} d x \sin ^{4}{\left (e + f x \right )}}{8} + \frac {3 b^{3} d x \sin ^{2}{\left (e + f x \right )} \cos ^{2}{\left (e + f x \right )}}{4} + \frac {3 b^{3} d x \cos ^{4}{\left (e + f x \right )}}{8} - \frac {5 b^{3} d \sin ^{3}{\left (e + f x \right )} \cos {\left (e + f x \right )}}{8 f} - \frac {3 b^{3} d \sin {\left (e + f x \right )} \cos ^{3}{\left (e + f x \right )}}{8 f} & \text {for}\: f \neq 0 \\x \left (a + b \sin {\left (e \right )}\right )^{3} \left (c + d \sin {\left (e \right )}\right ) & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.45, size = 152, normalized size = 0.89 \begin {gather*} \frac {b^{3} d \sin \left (4 \, f x + 4 \, e\right )}{32 \, f} + \frac {1}{8} \, {\left (8 \, a^{3} c + 12 \, a b^{2} c + 12 \, a^{2} b d + 3 \, b^{3} d\right )} x + \frac {{\left (b^{3} c + 3 \, a b^{2} d\right )} \cos \left (3 \, f x + 3 \, e\right )}{12 \, f} - \frac {{\left (12 \, a^{2} b c + 3 \, b^{3} c + 4 \, a^{3} d + 9 \, a b^{2} d\right )} \cos \left (f x + e\right )}{4 \, f} - \frac {{\left (3 \, a b^{2} c + 3 \, a^{2} b d + b^{3} d\right )} \sin \left (2 \, f x + 2 \, e\right )}{4 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 7.95, size = 183, normalized size = 1.07 \begin {gather*} \frac {2\,b^3\,c\,\cos \left (3\,e+3\,f\,x\right )-6\,b^3\,d\,\sin \left (2\,e+2\,f\,x\right )+\frac {3\,b^3\,d\,\sin \left (4\,e+4\,f\,x\right )}{4}-24\,a^3\,d\,\cos \left (e+f\,x\right )-18\,b^3\,c\,\cos \left (e+f\,x\right )-72\,a^2\,b\,c\,\cos \left (e+f\,x\right )-54\,a\,b^2\,d\,\cos \left (e+f\,x\right )+24\,a^3\,c\,f\,x+9\,b^3\,d\,f\,x+6\,a\,b^2\,d\,\cos \left (3\,e+3\,f\,x\right )-18\,a\,b^2\,c\,\sin \left (2\,e+2\,f\,x\right )-18\,a^2\,b\,d\,\sin \left (2\,e+2\,f\,x\right )+36\,a\,b^2\,c\,f\,x+36\,a^2\,b\,d\,f\,x}{24\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________